package com.qianli.cashmama.trade.domain.factory;

import com.qianli.cashmama.trade.client.trade.request.CreateAuditSuccessTradeRequest;
import com.qianli.cashmama.trade.client.trade.request.CreatePaySuccessTradeRequest;
import com.qianli.cashmama.trade.client.trade.request.CreateTradeRequest;
import com.qianli.cashmama.trade.client.trade.request.RepayTradeRequest;
import com.qianli.cashmama.trade.domain.model.TradeBank;
import com.qianli.cashmama.trade.domain.model.TradeBase;
import com.qianli.cashmama.trade.integration.product.dto.ProductDto;

/**
 * 交易基本的领域模型工厂方法
 * Created by scrack on 2017/7/20.
 */
public interface TradeBaseDomainFactory {
    /**
     * 组装构建交易（创建订单使用）
     *
     * @param createTradeRequest
     * @return
     */
    TradeBase composeTradeBase(CreateTradeRequest createTradeRequest);

    /**
     * 组装通过订单
     * @param request
     * @param productDto
     * @return
     */
    TradeBase composeAuditSuccessTradeBase(CreateAuditSuccessTradeRequest request, ProductDto productDto);

    /**
     * 组建风控通过交易
     * @param request
     * @return
     */
    TradeBase composePaySuccessTradeBase(CreatePaySuccessTradeRequest request, ProductDto productDto);

    /**
     * 组装构建交易（更新产品信息）
     *
     * @param tradeBase
     * @param productDto
     * @return
     */
    TradeBase convertTradeBase(TradeBase tradeBase, ProductDto productDto);

    /**
     * @param repayTradeRequest
     * @return
     */
    TradeBank composeTradeBank(RepayTradeRequest repayTradeRequest, TradeBank tradeBank);

}
